{extend name="Layout/datagrid" /}
{block name="head_foot"}
<!-- lightbox2 -->
<link rel="stylesheet" href="__ui_plugins__/lightboxlib/lightbox2/css/lightbox.min.css">
{/block}
{block name="content_header"}
<h1>
    网站管理员
    <small>advanced tables</small>
</h1>
<ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">管理员</a></li>
    <li class="active">网站管理员</li>
</ol>
{/block}
{block name="content"}
<div class="box">
    <div class="box-header">
        <div class="row">
            <div class="col-md-5">
                <button type="button" class="btn btn-default navbar-btn xsui-btn-add-dialog" data-url="{:url('edit')}" title="新增管理员">新增</button>
                <button type="button" class="btn btn-danger navbar-btn xsui-btn-multi-delete" data-url="{:url('delete','id=varkey')}" data-option='{"password":"yes","passwordMessage":"请输入口令[yes]"}'>批量删除</button>
                <button type="button" class="btn btn-info navbar-btn xsui-btn-multi-edit-dialog" data-url="{:url('User/department','id=varkey')}">快速编辑部门</button>
                <button type="button" class="btn btn-success navbar-btn xsui-btn-refresh">刷新</button>
            </div>
            <div class="col-md-7">
                <form class="navbar-form navbar-right">
                    <div class="form-group">
                        <select class="form-control" name="department_id" data-url="{:url('Department/getTreeJson')}" data-value="{$search.department_id}"><option>选择部门</option></select>
                    </div>
                    <div class="form-group">
                        <input type="text" name="word" class="form-control" placeholder="关键词..." title="用户名、姓名、手机号码、电子邮件" value="{$search['word']}">
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>
            </div>
        </div>
    </div>
    <!-- /.box-header -->
    <div class="box-body">
        <table class="xsui-datagrid table table-condensed table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th><input type="checkbox" class="xsui-btn-checking-all" /></th>
                    <th>#</th>
                    <th>用户名</th>
                    <th>姓名</th>
                    <th>头像</th>
                    <th>手机号码</th>
                    <th>电子邮件</th>
                    <th>积分</th>
                    <th>登录次数</th>
                    <th>角色</th>
                    <th>部门</th>
                    <th>在线</th>
                    <th>状态</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {foreach name="list" item="vo"}
                <tr data-key="{$vo.id}">
                    <td><input type="checkbox" value="{$vo.id}" /></td>
                    <td title="{$vo.id}"></td>
                    <td title="编号:id;性别:sex;注册日期:regist_time;最后登录:{$vo.login_time};最后IP:{$vo.login_ip}">{$vo.user_name}</td>
                    <td>{$vo.name}</td>
                    <td><a href="{$vo.face_url}" data-lightbox="example-set"><img class="img-responsive img-sm" src="{$vo.face_url}" alt="" /></a></td>
                    <td>{$vo.mobile}</td>
                    <td>{$vo.email}</td>
                    <td>{$vo.login_count}</td>
                    <td>{$vo.login_count}</td>
                    <td>{$vo.role_title}</td>
                    <td>{$vo.department_title}</td>
                    <td>{$vo.online_status_text}</td>
                    <td class="xsui-cell-status"><a href="{:url('User/changeStatus','id='.$vo['id'].'&status=varstatus')}" data-value="{$vo.status}" title="点击隐藏" class="text-success"><i class="fa fa-check fa-fw"></i></a></td>
                    <td class="xsui-action-td">
                        <div class="btn-group">
                            <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#">
                                操作
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu pull-right" style="min-width: 60px">
                                <li><a href="{:url('edit','id='.$vo['id'])}" class="xsui-btn-edit-dialog" title="编辑管理员 - {$vo.user_name}"><span class="glyphicon glyphicon-edit"></span>编辑</a></li>
                                <li><a href="{:url('User/role','id='.$vo['id'])}" class="xsui-btn-edit-dialog" title="角色设定 - {$vo.user_name}"><i class="fa fa-credit-card fa-fw"></i>角色</a></li>
                                <li><a href="{:url('User/department','id='.$vo['id'])}" class="xsui-btn-edit-dialog" title="部门设定 - {$vo.user_name}"><i class="fa fa-group fa-fw"></i>部门</a></li>
                                <li><a href="{:url('delete','id='.$vo['id'])}" class="xsui-btn-delete" title="删除管理员 - {$vo.user_name}"><span class="glyphicon glyphicon-remove"></span>删除</a></li>
                            </ul>
                        </div>
                    </td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        {$page}
    </div>
    <!-- /.box-body -->
</div>
<!-- /.box -->
{/block}
{block name="body_foot"}
<!-- lightbox2 -->
<script src="__ui_plugins__/lightboxlib/lightbox2/js/lightbox.min.js"></script>
{/block}
{block name="script_before"}
<script>
    $('select[name="department_id"]').ajaxcombobox({first:{id:"",text:"选择部门"}});
</script>
{/block}